home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Tele / C / Comet2.1.3.cpt / emlib / blank.asm < prev    next >
Assembly Source File  |  1990-06-26  |  1KB  |  50 lines

  1. ;    Copyright Cornell University 1986.  All rights are reserved.
  2. ;    kevin eric saunders
  3.  
  4.         public    _c19_blank
  5.         public    _c19_blankmap
  6.         public    _c19_blank
  7.         public    _c19_blankmap
  8.  
  9. ; a fast routine to blank a line 
  10. ;    entry    8(sp)    ->    position to start blanking
  11. ;            12(sp)    ->    count word
  12.  
  13. _c19_blank
  14.     move.l    4(sp),a0            ; a0 -> dest
  15.     move.w    8(sp),d0            ; d0 = count
  16.  
  17.     move.l    a0,a1
  18.     add.l    #1920,a1            ; a1 -> attributes    TODO should not use CONSTANT!
  19.     move.l    #$20202020,d2        ; d2 = blanks
  20.     move.l    #0,d3                ; d3 = null attr
  21.     move.w    d0,d1                ; d1 = count
  22.     bra.s    floop                ; jump into the dbra loop
  23. rpt1
  24.     move.b    d2,(a0)+
  25.     move.b    d3,(a1)+
  26. floop
  27.     dbra    d0,rpt1
  28.     rts
  29.  
  30.  
  31. ; blank the whole screen map, relatively quickly
  32.  
  33. _c19_blankmap
  34.     move.l    4(sp),a0            ; a0 -> dest
  35.     move.w    #480,d0                ; d0 = # of longs in screen 
  36.  
  37.     move.l    a0,a1
  38.     add.w    #1920,a1            ; a1 -> attributes
  39.     move.l    #$20202020,d2        ; d2 = blanks for charr array
  40.     move.l    #0,d3                ; d3 = null attr for attribute array
  41. do4
  42.     bra.s    inloop
  43. rpt4
  44.     move.l    d2,(a0)+
  45.     move.l    d3,(a1)+
  46. inloop
  47.     dbra    d0,rpt4
  48.     rts
  49.  
  50.